//code by Shallu
//to reverse a string

import java.util.*;

public class ReverseString {	
	
		public static void main(String args[])
		
		{			
			
			String str=new String("this is an example of reverse string");
			String[] arrstr = str.split(" ");
			
			String[] newarr=new String[arrstr.length];
			int j=arrstr.length-1;
									
			for(int i=0; i<arrstr.length; i++)
			{
					newarr[j]=arrstr[i];
					j--;
				}
				
			System.out.println(Arrays.toString(newarr));


		}
}




